package com.zcb.agrimarket.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 实验室表
 * @TableName lab
 */
@TableName(value ="lab")
@Data
public class Lab implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 实验室编号
     */
    @TableField(value = "lab_num")
    private String labNum;

    /**
     * 实验室名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 实验室类型
     */
    @TableField(value = "lab_type")
    private Long labType;

    /**
     * 实验室类型名
     */
    @TableField(value = "lab_type_name")
    private String labTypeName;

    /**
     * 实验员id
     */
    @TableField(value = "experimenter_id")
    private Long experimenterId;

    /**
     * 实验员名
     */
    @TableField(value = "experimenter_name")
    private String experimenterName;

    /**
     * 设备数量
     */
    @TableField(value = "device_num")
    private Integer deviceNum;

    /**
     * 维修状态 0-正常 1-异常
     */
    @TableField(value = "repair_state")
    private Integer repairState;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 逻辑删除 0-正常 1-已删除
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Lab other = (Lab) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getLabNum() == null ? other.getLabNum() == null : this.getLabNum().equals(other.getLabNum()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getLabType() == null ? other.getLabType() == null : this.getLabType().equals(other.getLabType()))
            && (this.getLabTypeName() == null ? other.getLabTypeName() == null : this.getLabTypeName().equals(other.getLabTypeName()))
            && (this.getExperimenterId() == null ? other.getExperimenterId() == null : this.getExperimenterId().equals(other.getExperimenterId()))
            && (this.getExperimenterName() == null ? other.getExperimenterName() == null : this.getExperimenterName().equals(other.getExperimenterName()))
            && (this.getDeviceNum() == null ? other.getDeviceNum() == null : this.getDeviceNum().equals(other.getDeviceNum()))
            && (this.getRepairState() == null ? other.getRepairState() == null : this.getRepairState().equals(other.getRepairState()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getLabNum() == null) ? 0 : getLabNum().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getLabType() == null) ? 0 : getLabType().hashCode());
        result = prime * result + ((getLabTypeName() == null) ? 0 : getLabTypeName().hashCode());
        result = prime * result + ((getExperimenterId() == null) ? 0 : getExperimenterId().hashCode());
        result = prime * result + ((getExperimenterName() == null) ? 0 : getExperimenterName().hashCode());
        result = prime * result + ((getDeviceNum() == null) ? 0 : getDeviceNum().hashCode());
        result = prime * result + ((getRepairState() == null) ? 0 : getRepairState().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", labNum=").append(labNum);
        sb.append(", name=").append(name);
        sb.append(", labType=").append(labType);
        sb.append(", labTypeName=").append(labTypeName);
        sb.append(", experimenterId=").append(experimenterId);
        sb.append(", experimenterName=").append(experimenterName);
        sb.append(", deviceNum=").append(deviceNum);
        sb.append(", repairState=").append(repairState);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}